Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FactoryBot/AssociationStyle nested factories #114

Merged

Conversation

jaydorsey
Copy link
Contributor

@jaydorsey jaydorsey commented Apr 24, 2024

Makes factory an explicit name to address nested factory edge case

fixes #113


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Updated documentation.
  • Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

If you have created a new cop:

  • Added the new cop to config/default.yml.
  • The cop is configured as Enabled: pending in config/default.yml.
  • The cop documents examples of good and bad code.
  • The tests assert both that bad code is reported and that good code is not reported.
  • Set VersionAdded: "<<next>>" in default/config.yml.

If you have modified an existing cop's configuration options:

  • Set VersionChanged: "<<next>>" in config/default.yml.

@jaydorsey jaydorsey requested a review from a team as a code owner April 24, 2024 13:27
Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you for handling this!

Can you please add a changelog entry? (You would have to add yourself to the list of contributors at the bottom of the file, sorted alphabetically).

spec/rubocop/cop/factory_bot/association_style_spec.rb Outdated Show resolved Hide resolved
@pirj
Copy link
Member

pirj commented Apr 24, 2024

Is it fair to say that this pr fixes #113?
Please feel free to remove this from the description if there will still be something to address wheb this is merged.

@jaydorsey
Copy link
Contributor Author

jaydorsey commented Apr 24, 2024

Is it fair to say that this pr fixes #113? Please feel free to remove this from the description if there will still be something to address wheb this is merged.

Yes, it does, thank you! I forgot to add the tag/annotation in the PR message. I'll make the update to the changelog and take a look at the spec name as well

@jaydorsey jaydorsey force-pushed the jaydorsey/association-style-nested-factory branch 2 times, most recently from c00250c to bf8cab4 Compare April 24, 2024 17:41
Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

RuboCop failure is unrelated. Seems to be caused by some upstream internal cop change causing intolerance to the “it ‘register offense’” instead of “registers offense”.

spec/rubocop/cop/factory_bot/association_style_spec.rb Outdated Show resolved Hide resolved
@pirj pirj requested a review from bquorning April 25, 2024 06:38
@ydah
Copy link
Member

ydah commented Apr 25, 2024

Could you rebase it to the latest master branch?

@jaydorsey jaydorsey force-pushed the jaydorsey/association-style-nested-factory branch from f30191b to 0091c62 Compare April 25, 2024 12:52
@jaydorsey
Copy link
Contributor Author

Could you rebase it to the latest master branch?

Done. If you could double-check it for me I'd appreciate it. I think I've got it rebased & squashed correctly but it's always nice to have a 2nd set of eyes

Thanks!

@pirj pirj requested a review from ydah April 25, 2024 13:24
Copy link
Member

@ydah ydah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you for your work❤️

@ydah ydah merged commit 0f0c954 into rubocop:master May 9, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FactoryBot/AssociationStyle error on nested factories
4 participants